/**
 * @file service_msg.h
 * @author HaoyuWang (136046355@qq.com)
 * @brief 服务消息
 * @version 0.1
 * @date 2025-01-24
 * 
 * @copyright Copyright (c) 2025
 * 
 */

#ifndef __SERVICE_MSG_H__
#define __SERVICE_MSG_H__

#include "base_msg.h"

#include <memory>
#include <cstdint>

class ServiceMsg: public BaseMsg 
{
public:
    ServiceMsg();
    ~ServiceMsg();

    inline void SetSource(uint32_t source){
        source_ = source;
    }
    inline uint32_t GetSource(){
        return source_;
    }

    inline void SetSize(size_t size){
        size_ = size;
    }
    inline size_t GetSize(){
        return size_;
    }

    inline void SetBuff(char* buff){
        buff_ = std::shared_ptr<char>(buff);
    }
    inline std::shared_ptr<char> GetBuff(){
        return buff_;
    }

public:
    uint32_t source_;  // 消息发送方
    std::shared_ptr<char> buff_;  // 消息内容
    size_t size_;  // 消息内容大小
};


#endif  // __SERVICE_MSG_H__